package com.demo.lease;

import com.demo.common.model.House;
import com.demo.common.model.Lease;
import com.demo.common.model.User;
import com.demo.common.util.WebUtil;
import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.SqlPara;

public class LeaseService {

    private Lease dao = new Lease().dao();

    public Page<Lease> paginate(int pageNumber, int pageSize) {
        return dao.paginate(pageNumber, pageSize, "select *", "from lease order by id asc");
    }

    public Page<Lease> paginate(int pageNumber, int pageSize, Kv cond) {
        SqlPara sqlPara = dao.getSqlPara("searchLease",cond);
        return dao.paginate(pageNumber, pageSize, sqlPara);
    }

    public Lease findById(int id) {
        return dao.findById(id);
    }

    public void deleteById(int id) {
        dao.deleteById(id);
    }
}
